#!/bin/bash

capturecount=0





function capture_av {
	
	#$1 = av
	#$3 = wait time
	 
	capturecount=$[capturecount + 1]
	
	#/main/settings/capturetarget
	
	gphoto2  \
	--quiet \
	--force-overwrite \
	--filename "output_$capturecount.%C" \
	--set-config-index aperture=$1 \
	--set-config eosremoterelease=Immediate \
	--set-config eosremoterelease=None \
	--wait-event-and-download=$2
	
}



function capture_tv {
	
	#$1 = tv
	#$3 = wait time
	 
	capturecount=$[capturecount + 1]
	
	#/main/settings/capturetarget
	
	gphoto2  \
	--quiet \
	--force-overwrite \
	--filename "output_$capturecount.%C" \
	--set-config-index shutterspeed=$1 \
	--set-config eosremoterelease=Immediate \
	--set-config eosremoterelease=None \
	--wait-event-and-download=$2 >/dev/null
	
	}


for i in `seq 0 16`;
do
	echo capturing $i
	capture_av $i 5s
	echo Capture $capturecount complete.
done


for i in `seq 52 -1 8`;
do
	echo Ramping up: $i
	capture_tv $i 
	echo finished capture.
done



echo Done!












